home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / CLIPVIEW.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  89 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1992, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.3  $
  6. //
  7. // Mixin class TClipboardViewer that allows a TWindow derived class to hook in
  8. // on the clipboard notification chain.
  9. //----------------------------------------------------------------------------
  10. #if !defined(OWL_CLIPVIEW_H)
  11. #define OWL_CLIPVIEW_H
  12.  
  13. #if !defined(OWL_WINDOW_H)
  14. # include <owl/window.h>
  15. #endif
  16.  
  17. #if defined(BI_NAMESPACE)
  18. namespace OWL {
  19. #endif
  20.  
  21. // Generic definitions/compiler options (eg. alignment) preceeding the 
  22. // definition of classes
  23. #include <services/preclass.h>
  24.  
  25. //
  26. // class TClipboardViewer
  27. // ~~~~~ ~~~~~~~~~~~~~~~~
  28. // Mix-in class that registers as a clipboard viewer when the user interface
  29. // element is created and removes itself from the clipboard-viewer chain when
  30. // it is destroyed
  31. //
  32. class _OWLCLASS TClipboardViewer : virtual public TWindow {
  33.   protected:
  34.     TClipboardViewer();
  35.     TClipboardViewer(HWND hWnd, TModule* module = 0);
  36.  
  37.     TEventStatus DoChangeCBChain(HWND hWndRemoved, HWND hWndNext);
  38.     TEventStatus DoDestroy();
  39.     TEventStatus DoDrawClipboard();  // pass to next window in clipboard-viewer chain
  40.  
  41.     // Override method defined by TWindow
  42.     //
  43.     void   SetupWindow();
  44.  
  45.     // Message response functions
  46.     //
  47.     void   EvChangeCBChain(HWND hWndRemoved, HWND hWndNext);
  48.     void   EvDestroy();
  49.     void   EvDrawClipboard();  // pass to next window in clipboard-viewer chain
  50.  
  51.     HWND  GetNextWindow() const;
  52.     void  SetNextWindow(HWND hwndnext);
  53.  
  54.   protected_data:
  55.     THandle  HWndNext;  // Next window in clipboard-viewer chain 
  56.  
  57.   private:
  58.     // Hidden to prevent accidental copying or assignment
  59.     //
  60.     TClipboardViewer(const TClipboardViewer&);
  61.     TClipboardViewer& operator =(const TClipboardViewer&);
  62.  
  63.   DECLARE_RESPONSE_TABLE(TClipboardViewer);
  64.   DECLARE_CASTABLE;
  65. };
  66.  
  67. // Generic definitions/compiler options (eg. alignment) following the 
  68. // definition of classes
  69. #include <services/posclass.h>
  70.  
  71. #if defined(BI_NAMESPACE)
  72. } // namespace OWL
  73. #endif
  74.  
  75. //
  76. // Inline implementations
  77. //
  78.  
  79. //
  80. inline HWND  TClipboardViewer::GetNextWindow() const {
  81.   return HWndNext;
  82. }
  83.  
  84. //
  85. inline void  TClipboardViewer::SetNextWindow(HWND hwndnext) {
  86.   HWndNext = hwndnext;
  87. }
  88. #endif  // OWL_CLIPVIEW_H
  89.